#f'{表达式} 引用变量

name = 'fdd'
age = 26
print("年龄: %s, 年龄：%d" %(name,age))
print(f"名字: {name}, 年龄: {age}")

#字符串拼接
s1 = "hello"
s2 = "world"
print(f"{s1} {s2}")
print(s1 + s2)
print(s1,s2)

#获取字符串长度 len()
s = "hello world"
print(len(s))

#字符串切片
s = ("hello world")
print(s[-2])
print(s[3:-1])